package com.fram.service.api.v1.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.fram.common.canstant.ErrCode;
import com.fram.common.exception.ProException;
import com.fram.common.exception.ProValiDataException;
import com.fram.entity.Checkversion;
import com.fram.mapper.CheckversionMapper;
import com.fram.service.api.v1.CheckversionSerivce;
@Service
public class CheckversionSerivceImpl implements CheckversionSerivce{
	
	@Autowired
	private CheckversionMapper checkversionMapper;

	@Override
	public Checkversion list(Checkversion request) throws ProException {
		Checkversion requests = checkversionMapper.selectForApi(request);
		if(requests==null) {
			throw new ProValiDataException(ErrCode.NO_DATA.getReturnCode(), ErrCode.NO_DATA.getReturnMsg());
		}
		return requests;
	}

	@Override
	public Checkversion details(Long id)throws ProException {
		Checkversion request = checkversionMapper.selectByPrimaryKey(id);
		if(request==null) {
			throw new ProValiDataException(ErrCode.NO_DATA.getReturnCode(), ErrCode.NO_DATA.getReturnMsg());
		}
		return request;
	}

}
